<?php
	require("connect.php");
	$pID = $_REQUEST["txtpID"];
	$pName = $_REQUEST["txtpName"];
	$pImage = $_REQUEST["file"];
	//move_uploaded_file($_REQUEST["file"]["tmp_name"], "images/".$pImage);
	$pAmount = $_REQUEST["txtpAmount"];
	$pWarranty = $_REQUEST["txtpWarranty"];
	$pDetail = $_REQUEST["txtpDetail"];
	$pPrice = $_REQUEST["txtpPrice"];
	$catID = $_REQUEST["slCatagory"] ;
	$subID = $_REQUEST["slSubplier"];
	$pStatus = $_REQUEST["txtpStatus"];
	$ptID = $_REQUEST["slPromotion"];
	$sqlUpdate = "Update product set pName = '{$pName}',pImage = '{$pImage}',pAmount = {$pAmount},pWarranty = {$pWarranty},pDetail = '{$pDetail}', pPrice = {$pPrice},catID = {$catID},subID = {$subID},pStatus = {$pStatus},ptID = {$ptID} where pID = {$pID}";
	mysql_query($sqlUpdate) or die ("Not excute command ".$sqlUpdate);
	mysql_close();
	echo "<script>window.location='quanlysanpham.php';</script>";
?>
